//
//  TKYMessagePhotoOrVideoCell.m
//  StationHouseHelper
//
//  Created by apple on 2018/6/27.
//  Copyright © 2018年 铁科院. All rights reserved.
//

#import "TKYMessagePhotoOrVideoCell.h"
#import "TKYPhotoOrVideoView.h"
@implementation TKYMessagePhotoOrVideoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.showImageView];
        [self.contentView addSubview:self.bimButton];

        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            //make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(10, 10, 10, 10));
            make.left.equalTo(self.contentView).with.offset(20);
            make.top.equalTo(self.contentView).with.offset(5);
            //make.right.equalTo(self.contentView).with.offset(-10);
            make.height.mas_equalTo(20);
            make.width.mas_equalTo(100);

        }];
        
        
        [self.showImageView mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(25, 10, 10, 10));
            make.left.equalTo(self.contentView).with.offset(20);
            make.top.equalTo(self.titleLabel.mas_bottom).offset(0);
            make.right.equalTo(self.contentView).with.offset(-10);
            make.bottom.equalTo(self.contentView).offset(-10);
            make.height.mas_equalTo(100);
        }];
        
        [self.bimButton mas_makeConstraints:^(MASConstraintMaker *make) {
            //make.left.equalTo(self.contentView).with.offset(20);
            make.top.equalTo(self.contentView).with.offset(5);
            make.right.equalTo(self.contentView).with.offset(-10);
            make.height.mas_equalTo(20);
            make.width.mas_equalTo(60);
        }];
        
        TKYPhotoOrVideoView *view1 =  [[TKYPhotoOrVideoView alloc]init];
        
        view1.backgroundColor = [UIColor redColor];
        [self.showImageView addSubview:view1];
        
    }
    return self;
}

- (UILabel *)titleLabel{
    if (_titleLabel == nil) {
        _titleLabel = [[UILabel alloc]init];
        _titleLabel.text = @"照片或视频";
        _titleLabel.font = Font(12);
    }
    return _titleLabel;
}

- (UIView *)showImageView{
    if (_showImageView == nil) {
        _showImageView = [[UIView alloc]init];
    }
    return _showImageView;
}

- (UIButton *)bimButton{
    if (_bimButton == nil) {
        _bimButton = [[UIButton alloc]init];
        _bimButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_bimButton setTitle:@"查看BIM" forState:UIControlStateNormal];
        _bimButton.titleLabel.font = Font(12);
        [_bimButton setTitleColor:KNavColor forState:UIControlStateNormal];
    }
    return _bimButton;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
